package com.corejava.training.collections.set;

import java.util.*;

public class SimpleLinkedHash {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		// create a Set and add class students' name on it
		// Duplicates not allowed, LinkedHashSet print out according to insert order
		Set<String> simpleSet = new LinkedHashSet<String>();
		simpleSet.add("Reeno");
		simpleSet.add("Arman");
		simpleSet.add("sushil");
		simpleSet.add("Arman");
		simpleSet.add("Binod");
		simpleSet.add("sushil");
		simpleSet.add("sushil");
	
		simpleSet.add(null);

		// read from the Set and print out with jdk 1.4 style
		Iterator<String> ite = simpleSet.iterator();
		while (ite.hasNext()) {

			String sS = (String) ite.next();
			System.out.println("Student Names: " + sS);

		}

	}

}
